﻿<%@ page import="us.nchu.tomtiger.model.Project" %>
<%@ page import="java.util.List" %>
<%@ page import="us.nchu.tomtiger.model.ProjectPending" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<meta charset="utf-8">


<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />

<title>审核用户</title>
</head>
<body style="background: #FFF">
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户管理 <span class="c-gray en">&gt;</span> 审核项目 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="pd-20">
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				<tr class="text-c">
					<th width="80">项目名</th>
					<th width="80">负责人</th>
					<th width="120">项目类型</th>
					<th width="120">所属领域</th>
					<th width="80">项目介绍</th>
					<th width="80">联系方式</th>
					<th width="120">操作</th>
				</tr>
			</thead>
			<tbody>
                <p hidden id="adminId">${requestScope.adminId}</p>
                <%
                    String[] types = new String[]{
                            "",
                            "硬件",
                            "APP",
                            "网站",
                            "软件",
                            "线下实体",
                            "电子商务"
                    };
                    String[] contacts = new String[]{
                            "",
                            "QQ",
                            "微信",
                            "邮箱"
                    };

                    List<Project> projectList = (List<Project>) request.getAttribute("projectList");
                    List<ProjectPending> projectPendingList = (List<ProjectPending>) request.getAttribute("projectPendingList");

                    if (projectList.size() == 0) {
                        out.print("没有待审核的用户");
                    }
                    else {
                        Project project;
                        ProjectPending projectPending;
                        for (int i = 0 ; i < projectList.size(); i++) {
                            project = projectList.get(i);
                            projectPending = projectPendingList.get(i);

                            out.print("<tr class=\"text-c\">");
                            out.print("<td>" + java.net.URLDecoder.decode(project.getName(), "utf-8") + "</td>");
                            out.print("<td>" + java.net.URLDecoder.decode(project.getPhoneNumber(), "utf-8") + "</td>");
                            out.print("<td>" + types[project.getType()] + "</td>");
                            out.print("<td>" + java.net.URLDecoder.decode(project.getField(), "utf-8") + "</td>");
                            out.print("<td>" + java.net.URLDecoder.decode(project.getIntro(), "utf-8") + "</td>");
                            out.print("<td>" + project.getContact() + "(" + contacts[project.getContactType()] + ")" + "</td>");
                            out.print("<td class=\"f-14 td-manage\">");
                            out.print("<a style=\"text-decoration:none\" class=\"ml-5\" href=\"javascript:void(0)\" onClick=\"passProjectPending(" + projectPending.getId() + "," + project.getId() + ")\" title=\"通过\"><i class=\"Hui-iconfont\">&#xe6e1;</i></a>");
                            out.print("<a style=\"text-decoration:none\" class=\"ml-5\" href=\"javascript:void(0)\" onClick=\"failProjectPending(" + projectPending.getId() + "," + project.getId() + ")\" title=\"不通过\"><i class=\"Hui-iconfont\">&#xe6dd;</i></a>");
                            out.print("</td></tr>");
                        }
                    }
                %>



				<%--<tr class="text-c">--%>
					<%--<td></td>--%>
					<%--<td>10001</td>--%>
					<%--<td></td>--%>
					<%--<td></td>--%>
					<%--<td></td>--%>
					<%--<td></td>--%>
					<%--<td class="td-status"><span class="label label-success radius"></span></td>--%>
					<%--<td class="f-14 td-manage">--%>
						<%--<a style="text-decoration:none" onClick="article_shenhe(this,'10001')" href="javascript:;" title="审核">--%>
							<%--审核--%>
						<%--</a> --%>
					<%--</td>--%>
				<%--</tr>--%>
			</tbody>
		</table>
	</div>
</div>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script> 
<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script>
<script type="text/javascript" src="js/admin.js"></script>
<script type="text/javascript">
$('.table-sort').dataTable({
	"aaSorting": [[ 1, "desc" ]],//默认第几个排序
	"bStateSave": true,//状态保存
	"aoColumnDefs": [
	  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	  {"orderable":false,"aTargets":[0,8]}// 制定列不参与排序
	]
});


/*用户-审核*/
function article_shenhe(obj,id){
	layer.confirm('审核用户？', {
		btn: ['通过','不通过'], 
		shade: false
	},
	function(){
		$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_start(this,id)" href="javascript:;" title="审核">审核</a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已审核</span>');
		$(obj).remove();
		layer.msg('已审核', {icon:6,time:1000});
	},
	function(){
		$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_shenqing(this,id)" href="javascript:;" title="审核通过">审核通过</a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-danger radius">未通过</span>');
		$(obj).remove();
    	layer.msg('未审核', {icon:5,time:1000});
	});	
}


</script> 
</body>
</html>